1. Field of Endeavor
The present disclosure relates to a data storing method, and more particularly to a data log module which is PLC (Programmable Logic Controller) expansion module and a method for storing data in the PLC data log module.
2. Background
Automation facilities at a traditional industrial site include mechanical devices such as a relay and the like. There is a difficulty in replacing wirings, each at a time, of an inner circuit in the automation facilities in order to change functions of the automation facilities configured with mechanical devices.
To solve the difficulties, a programmable logic controller (PLC) is typically employed. The PLC generally includes a basic module and a wide variety of expansion modules.
The PLC is largely controlled in an unmanned manner, and therefore, ex post facto measures must be taken to solve an abnormal operation if it is generated. A series of operations may be monitored or a log data of past history may be stored to check if and how the abnormal operation has been generated. As a large capacity of storage to check the abnormal operation, a CF (Compact Flash) memory or a USB (Universal Serial Bus) memory may be used to store the log data in ‘FAT32’ file system developed by Microsoft Corporation, Redmond, Wash. USA. FAT32 data is simple and fast in processing speed to be widely employed as file systems for industrial control devices. The stored FAT32 data may be stored in a removal storage device such as the CF memory or the USB memory, which is then removed from a data log module of PLC and the data stored in the FAT32 may be read out and analyzed using a personal computer or a data display device.
Recently, the USB memory and CF memory increases in usage, and are widely used as storage media because of large capacity and fast storage time. Although the USB memory and CF memory are easy in attachment and detachment, the abnormal operation of PLC cannot be detected by a data log module-removed state, and data cannot be disadvantageously stored.
FIG. 1 is a block diagram illustrating a data log module according to prior art.
Referring to FIG. 1, a data log module 100 according to the prior art is connected to a PLC basic module 200 and a power module 300, where the PLC basic module 200 reads out a parameter set up at the data log module 100 and transmits a relevant device data of the basic module 200 to the data log module 100. The power module 300 supplies a power required for operation of data log module 100.
A MPU (Micro Processor Unit, 110) performs an overall control of the data log module 100, and a RAM (Random Access Memory, 120) temporarily stores data of the basic module 200 read out by a common RAM 140. A display unit 130 displays an operation state of the data log module 100. The common RAM 140, a dual-port RAM commonly using read/write with the basic module 200, performs an interface with the basic module 200. A buffer 150 divides a CF memory 160 and an inner data bus, where CD is a signal for checking whether CF memory 160 is attached, and OE is an enable signal of CF memory 160. The CF memory 160, as explained above, permanently stores a log data that needs preservation in an FAT32 file structure.
FIG. 2 is a flowchart of data storage method of data log module according to prior art.
Referring to FIG. 2, the data log module according to prior art checks if the CF memory 160 is attached S22, in a case data storage condition is generated S21. If the CF memory 160 is not attached, an error is generated S23 because there is no room for data storage. Meanwhile, in a case data storage condition is not generated S21, the data log module according to prior art checks if a removal condition for CF memory 160 is generated S27.
The CF memory 160 is configured with an attachment/detachment structure unlike the conventional memory, and cannot be directly connected to an inner data bus and can be connected to the inner data bus through the buffer 150.
In order to attach and detach the CF memory 160, a CF memory removal signal must be inputted into the data log module 100 before attachment or detachment of the CF memory 160. That is, in a case the CF memory removal signal is inputted, the data log module 100 deactivates the buffer S28, safely detach the inner data bus from the CF memory S29 and ends the data logging.
In S22, in a case the CF memory 160 is attached, data of the common RAM 140 is copied to the RAM 120 S24 and processed in a file system (FAT320) format S25. Successively, the data log module 100 checks if the CF memory removal condition is ON S27, keeps performing a data logging if it is determined that the CF memory removal condition is not ON, and deactivates the buffer 150 S28 and removes the CF memory 160 S29 if it is determined that the CF memory removal condition is ON, whereby the data logging is finished.
However, as explained above, the data log module 100 according to the prior art is problematic in that it cannot back up important data, because it cannot store the PLC inner data in the CF memory 160, in a case the CF memory 160 is removed. Another problem is that data can be backed up by attaching only one CF memory 160 on the data log module 100, such that in a case life of the CF memory 160 ceases or the CF memory 160 is broken, the data cannot be backed up. Still another problem of the data log module 100 according to the prior art is that the stored data of the CF memory 160 can be hardly reliable. Accordingly, there is room for improvement in the PLC data log module.